{% extends 'myhome/base.html' %}

{% block con %}
<div class="breadcrumbs-area mb-70">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <div class="breadcrumbs-menu">
                    <ul>
                        <li><a href="#">首页</a></li>
                        <li><a href="#" class="active">个人订单中心</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="entry-header-area">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <div class="entry-header-title">
                    <h2>我的订单</h2>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="cart-main-area mb-70">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <form action="#">
                    <div class="table-content table-responsive">
                        {% for i in user.order_set.all %}
                        <table>
                            <thead>
                                <tr style="background: #ccc;">
                                    <th rowspan="5" style="text-align: left" class="product-thumbnail">
                                        订单时间：{{ i.ordertime }}
                                        &nbsp;&nbsp;&nbsp;
                                        订单号：{{ i.id }}
                                    </th>
                                    <th class="product-remove">订单总价：{{ i.totalprice }}</th>
                                    <th class="product-remove">
                                        订单状态：
                                        {% if i.status == 0 %}
                                        <span style="color: red">未支付</span>
                                        {% elif i.status == 1 %}
                                        <span style="color: green">已支付</span>
                                        {% elif i.status == 2 %}
                                        <span style="color: yellow">待收货</span>
                                        {% elif i.status == 3 %}
                                        <span style="color: grey">已取货</span>
                                        {% elif i.status == 4 %}
                                        <span style="color: grey">已取消</span>
                                        {% endif %}
                                    </th>
                                    <th class="product-remove">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            {% for ii in i.orderdetail_set.all %}
                                <tr>
                                    <td class="product-thumbnail">
                                        <a href="#"><img style="width: 100px" src="/{{ ii.bid.bookimgs_set.first.img_url }}"  alt="男人"></a>
                                        {{ ii.bid.title }}
                                    </td>
                                    {% load pagetag %}
                                    <td class="product-subtotal">￥<span>{% cheng ii.bid.price ii.num %}</span></td>
                                    <td class="product-name"></td>
                                    <td class="product-remove">
                                        <a href="javascript:void(0)"><i class="fa fa-times"></i></a>
                                    </td>

                                </tr>
                            {% endfor %}
                            </tbody>
                        </table>
                        {% endfor %}
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %}

